import { useEffect, useState } from "react";

const useHooks = (value: string, delay: number) => {
  const [val, setVal] = useState("");
  useEffect(() => {
    let timer = setTimeout(() => {
      setVal(value);
    });

    return () => {
      clearTimeout(timer);
    };
  }, [value, delay]);
  return val;
};

export default useHooks;
